package c.d.a.a.j;

import android.graphics.Matrix;
import android.graphics.Path;
import android.graphics.RectF;

/* compiled from: Transformer */
public class f {
    public Matrix a = new Matrix();
    public Matrix b = new Matrix();
    public h c;
    public float[] d = new float[1];
    public Matrix e = new Matrix();
    public float[] f = new float[2];
    public Matrix g = new Matrix();

    public f(h hVar) {
        Matrix matrix = new Matrix();
        this.c = hVar;
    }

    public c a(float f, float f2) {
        float[] fArr = this.f;
        fArr[0] = f;
        fArr[1] = f2;
        f(fArr);
        float[] fArr2 = this.f;
        return c.b((double) fArr2[0], (double) fArr2[1]);
    }

    public c b(float f, float f2) {
        c b = c.b(0.0d, 0.0d);
        c(f, f2, b);
        return b;
    }

    public void c(float f, float f2, c cVar) {
        float[] fArr = this.f;
        fArr[0] = f;
        fArr[1] = f2;
        e(fArr);
        float[] fArr2 = this.f;
        cVar.b = (double) fArr2[0];
        cVar.c = (double) fArr2[1];
    }

    public void d(Path path) {
        path.transform(this.a);
        path.transform(this.c.a);
        path.transform(this.b);
    }

    public void e(float[] fArr) {
        Matrix matrix = this.e;
        matrix.reset();
        this.b.invert(matrix);
        matrix.mapPoints(fArr);
        this.c.a.invert(matrix);
        matrix.mapPoints(fArr);
        this.a.invert(matrix);
        matrix.mapPoints(fArr);
    }

    public void f(float[] fArr) {
        this.a.mapPoints(fArr);
        this.c.a.mapPoints(fArr);
        this.b.mapPoints(fArr);
    }

    public void g(boolean z) {
        this.b.reset();
        Matrix matrix;
        if (z) {
            matrix = this.b;
            RectF rectF = this.c.b;
            matrix.setTranslate(rectF.left, -rectF.top);
            this.b.postScale(1.0f, -1.0f);
            return;
        }
        matrix = this.b;
        h hVar = this.c;
        matrix.postTranslate(hVar.b.left, hVar.d - hVar.l());
    }

    public void h(float f, float f2, float f3, float f4) {
        float b = this.c.b() / f2;
        f2 = this.c.b.height() / f3;
        if (Float.isInfinite(b)) {
            b = 0.0f;
        }
        if (Float.isInfinite(f2)) {
            f2 = 0.0f;
        }
        this.a.reset();
        this.a.postTranslate(-f, -f4);
        this.a.postScale(b, -f2);
    }
}
